1. Field of the Invention
The present invention relates to a mobile device that calibrates an integrated magnetic sensor, a calibration method for a magnetic sensor, and an information storage medium having a program stored thereon, which is used for calibrating a magnetic sensor.
2. Description of the Related Art
A magnetic sensor is used for detecting the direction (azimuth) of a mobile device. The direction of the mobile device incorporating the magnetic sensor can be identified based on the direction of the geomagnetism detected by the magnetic sensor. The magnetic sensor has one or more reference axes, and outputs output values indicating magnitudes of magnetism along directions of the respective reference axes. The output value of the magnetic sensor is a sum of an offset value (output value acquired if the geomagnetism is not present) and a value corresponding to the magnitude of the geomagnetism, and the offset value changes depending on an influence of a surrounding magnetic field. It is thus necessary to precisely estimate the offset value in order to identify the direction of the geomagnetism using output data of the magnetic sensor. Calibration processing is thus carried out for estimating the offset value. Specifically, the mobile device acquires the output data of the magnetic sensor while prompting a user to perform an action of rotating the mobile device, for example. As a result of this operation, both an output acquired when the reference axis of the magnetic sensor coincides with the geomagnetism, and an output acquired when the reference axis is opposite to the geomagnetism are acquired. The offset value is then calculated by means of a method such as averaging the maximum value and the minimum value of the output value of the magnetic sensor acquired during this operation.
It is necessary to prompt a user to intentionally perform a special action in order to carry out such calibration processing as described above. If the calibration to be carried out by simply using sampling data items acquired by sampling outputs of the magnetic sensor for certain number of times without the special action, the offset value having a sufficient accuracy may not be obtained. This is because sampling data items are necessary respectively obtained before and after a relatively large change in the posture of the mobile device in order to carry out the calibration processing, and it is not possible to guarantee that such a change of the posture occurs in the mobile device unless the user is prompted to perform the special action.